/*
 * @Author: 邱狮杰
 * @Date: 2021-05-14 22:52:12
 * @LastEditTime : 2021-05-20 17:02:14
 * @FilePath     : /wedding-dress-selection/src/App.tsx
 * @Description: index
 */
import './app.scss'
import { Redirect, Route, Switch } from 'react-router-dom'
import Index from './page/index/index'
import Main from './page/main/index'
import Select from './page/selectionRecommendation/index'
import End from './page/submitted/index'
import Category from './page/category/index'
// import { BaseRequest } from './http/index'
// import { useMounted } from './hook/index'
// import { SynchronizationAwaitError } from './utils/index'
function App() {
  // const [swiperCore] = useState(new Swiper('.containerApp', {init: false, initialSlide: 0}))
  // useEffect(() => {
  //     swiperCore.init()
  // }, [swiperCore])
  // useMounted(async () => {
  //   const [err, res] = await SynchronizationAwaitError(BaseRequest({ url: '/invitation-bind', method: 'POST', data: { code: 1 } }), undefined, { bindError: '绑定失败' })
  //   console.log(err, res)
  // })
  return (
    <div>
      <Switch>
        <Route path='/index' component={Index} />
        <Route path='/category' component={Category} />
        <Route path='/main' component={Main} />
        <Route path='/select' component={Select} />
        <Route path='/end' component={End} />
      </Switch>
      <Redirect to='/index' />
    </div>
  )
}

export default App
